import java.awt.geom.Line2D;


public class OrientedShape extends Shape{
	protected Line2D direction;
	
	public OrientedShape(){
		super();
		direction = new Line2D.Double(0,0,0,1);
	}
	
	public void setDirection(double x, double y){
		double norm = Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2));
		direction = new Line2D.Double(0,0,x/norm,y/norm);;
	}
	
	public void setDirectionRad(double theta){
		setDirection(Math.cos(theta),Math.sin(theta));
	}
	
	public void setDirectionDegree(double alpha){
		double theta = alpha * Math.PI / 180;
		setDirectionRad(theta);
	}
	
	public Line2D getDirection(){
		return direction;
	}
}
